/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pos.system;

import java.text.DecimalFormat;
import java.text.NumberFormat;

/**
 *
 * @author Shameera
 */
public class OrderItem {
    private String name;
    private String code;
    private String seller;
    private int amount;
    private double price;
    private double totalPrice;
    NumberFormat moneyFormat = new DecimalFormat("###.00");

    public OrderItem(String name, String code,String seller, int amount, double price) {
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.price = price;
        this.seller = seller;
        this.totalPrice = this.amount*this.price;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public String getSeller() {
        return seller;
    }

    public int getAmount() {
        return amount;
    }

    public double getPrice() {
        return price;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public String getPriceAsMoneyString() {
        return moneyFormat.format(price);
    }

    public String getTotalPriceAsMoneyString() {
        return moneyFormat.format(totalPrice);
    }

    
    
}
